Skip to main content
Version: Upcoming

MarRiskControl

V8 Message Definiton

MarRiskControl records are used to establish risk controls within SpiderRock execution engines. These records are only viewable and editable by users belonging to the same riskFirm as the control records.

METADATA

AttributeValue
Topic4535-risk-control
MLink TokenClientControl
ProductSRControl
accessTypeSELECT,UPDATE,INSERT,DELETE

Table Definition

FieldTypeKeyDefault ValueComment
riskFirmVARCHAR(16)PRI''If exists a client firm imposing risk controls should be an existing SR client ID
riskGroupVARCHAR(16)PRI''The ID of the risk group these rules will apply to
isTestAccntenum - YesNoPRI'None'If Yes this control applies only to risk for test accounts
stkEnabledenum - MarState'None'Enabled or not for equities Nonedisabled
futEnabledenum - MarState'None'Enabled or not for futures Nonedisabled
optEnabledenum - MarState'None'Enabled or not for options Nonedisabled
marginLimitAccFLOAT0Maximum net per symbol total portfolio startofday positions day trades margin can include external sources
marginLimitDayFLOAT0Maximum net per symbolday day portfolio day trades only margin can include external sources
openExposureLimitFLOAT0Maximum abs open child order Delta no netting open child orders only
maxAccFutCnAbsINT0Maximum absolute net account future contracts
maxDayFutCnBotINT0Day future contracts bot
maxDayFutCnSldINT0Day future contracts sld
maxDayFutCnAbsINT0Maximum absolute net day future contracts
orderMaxStkQtyINT0Number of equity shares that can be bought or sold by a single parent order
orderMaxFutQtyINT0Number of futures contracts that can be bought or sold by a single parent order
orderMaxOptQtyINT0Number of option contracts that can be bought or sold by a single parent order
orderMaxStkDDeltaFLOAT0Maximum abs mny per stock parent order ddelta 001 shares pointValue midPrc
orderMaxFutDDeltaFLOAT0Maximum abs mny per future parent order ddelta 001 contracts pointValue midPrc
orderMaxOptDDeltaFLOAT0Maximum abs mny per option parent order ddelta 001 contracts pointValue ABSde uMidPrc
stkCollarPctFLOAT0Maximum user limit vs bidask price control percentage in decimals
futCollarPctFLOAT0Maximum user limit vs bidask price control percentage in decimals
optCollarPctFLOAT0Maximum user limit vs bidask price control percentage in decimals
allowStkOddLotsenum - YesNo'None'Allow parent stock orders with an order size below 100
allowLimitOnCloseenum - YesNo'None'Allow limit on close orders similar to MOC order with the addition of a price limit
allowMarketOnCloseenum - YesNo'None'Allow market on close orders special order type which is executed as close to the close of trading as possible
allowShortSaleExemptenum - YesNo'None'Allow short sale option orders to be marked exempt as per Rule 201
allowInterMarketSweepenum - YesNo'None'Allow intermarket sweep orders
blockShortSalesenum - YesNo'None'Block all short sales
modifiedByVARCHAR(24)''User that last modified this record
modifiedInenum - SysEnvironment'None'Environment this record was last updated in
timestampDATETIME(6)'1900-01-01 00:00:00.000000'Timestamp of this record

PRIMARY KEY DEFINITION (Unique)

FieldSequence
riskFirm1
riskGroup2
isTestAccnt3

CREATE TABLE EXAMPLE QUERY

CREATE TABLE `SRControl`.`MsgMarRiskControl` (
`riskFirm` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'If exists, a client firm imposing risk controls (should be an existing SR client ID)',
`riskGroup` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'The ID of the risk group these rules will apply to',
`isTestAccnt` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'If Yes, this control applies only to risk for test accounts',
`stkEnabled` ENUM('None','Enable','Disabled','CloseOnly') NOT NULL DEFAULT 'None' COMMENT 'Enabled or not for equities (None=disabled)',
`futEnabled` ENUM('None','Enable','Disabled','CloseOnly') NOT NULL DEFAULT 'None' COMMENT 'Enabled or not for futures (None=disabled)',
`optEnabled` ENUM('None','Enable','Disabled','CloseOnly') NOT NULL DEFAULT 'None' COMMENT 'Enabled or not for options (None=disabled)',
`marginLimitAcc` FLOAT NOT NULL DEFAULT 0 COMMENT 'Maximum net (per symbol) total portfolio (start-of-day positions + day trades) margin (can include external sources)',
`marginLimitDay` FLOAT NOT NULL DEFAULT 0 COMMENT 'Maximum net (per symbol/day) day portfolio (day trades only) margin (can include external sources)',
`openExposureLimit` FLOAT NOT NULL DEFAULT 0 COMMENT 'Maximum abs open child order $Delta (no netting) (open child orders only)',
`maxAccFutCnAbs` INT NOT NULL DEFAULT 0 COMMENT 'Maximum absolute (net) account future contracts',
`maxDayFutCnBot` INT NOT NULL DEFAULT 0 COMMENT 'Day future contracts bot',
`maxDayFutCnSld` INT NOT NULL DEFAULT 0 COMMENT 'Day future contracts sld',
`maxDayFutCnAbs` INT NOT NULL DEFAULT 0 COMMENT 'Maximum absolute (net) day future contracts',
`orderMaxStkQty` INT NOT NULL DEFAULT 0 COMMENT 'Number of equity shares that can be bought or sold by a single parent order',
`orderMaxFutQty` INT NOT NULL DEFAULT 0 COMMENT 'Number of futures contracts that can be bought or sold by a single parent order',
`orderMaxOptQty` INT NOT NULL DEFAULT 0 COMMENT 'Number of option contracts that can be bought or sold by a single parent order',
`orderMaxStkDDelta` FLOAT NOT NULL DEFAULT 0 COMMENT 'Maximum (abs) mny per stock parent order; ddelta = 0.01 * shares * pointValue * midPrc',
`orderMaxFutDDelta` FLOAT NOT NULL DEFAULT 0 COMMENT 'Maximum (abs) mny per future parent order; ddelta = 0.01 * contracts * pointValue * midPrc',
`orderMaxOptDDelta` FLOAT NOT NULL DEFAULT 0 COMMENT 'Maximum (abs) mny per option parent order; ddelta = 0.01 * contracts * pointValue * ABS(de) * uMidPrc',
`stkCollarPct` FLOAT NOT NULL DEFAULT 0 COMMENT 'Maximum user limit vs bid/ask price control - percentage in decimals',
`futCollarPct` FLOAT NOT NULL DEFAULT 0 COMMENT 'Maximum user limit vs bid/ask price control - percentage in decimals',
`optCollarPct` FLOAT NOT NULL DEFAULT 0 COMMENT 'Maximum user limit vs bid/ask price control - percentage in decimals',
`allowStkOddLots` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'Allow parent stock orders with an order size below 100',
`allowLimitOnClose` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'Allow limit on close orders - similar to MOC order, with the addition of a price limit',
`allowMarketOnClose` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'Allow market on close orders - special order type which is executed as close to the close of trading as possible',
`allowShortSaleExempt` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'Allow short sale option orders to be marked exempt, as per Rule 201',
`allowInterMarketSweep` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'Allow intermarket sweep orders',
`blockShortSales` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'Block all short sales',
`modifiedBy` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'User that last modified this record',
`modifiedIn` ENUM('None','Neptune','Pluto','V7_Stable','V7_Latest','Saturn','Venus','Mars','SysTest','V7_Current') NOT NULL DEFAULT 'None' COMMENT 'Environment this record was last updated in',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'Timestamp of this record',
PRIMARY KEY USING HASH (`riskFirm`,`riskGroup`,`isTestAccnt`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='MarRiskControl records are used to establish risk controls within SpiderRock execution engines. These records are only viewable and editable by users belonging to the same riskFirm as the control records.';

SELECT TABLE EXAMPLE QUERY

SELECT
`riskFirm`,
`riskGroup`,
`isTestAccnt`,
`stkEnabled`,
`futEnabled`,
`optEnabled`,
`marginLimitAcc`,
`marginLimitDay`,
`openExposureLimit`,
`maxAccFutCnAbs`,
`maxDayFutCnBot`,
`maxDayFutCnSld`,
`maxDayFutCnAbs`,
`orderMaxStkQty`,
`orderMaxFutQty`,
`orderMaxOptQty`,
`orderMaxStkDDelta`,
`orderMaxFutDDelta`,
`orderMaxOptDDelta`,
`stkCollarPct`,
`futCollarPct`,
`optCollarPct`,
`allowStkOddLots`,
`allowLimitOnClose`,
`allowMarketOnClose`,
`allowShortSaleExempt`,
`allowInterMarketSweep`,
`blockShortSales`,
`timestamp`
FROM `SRControl`.`MsgMarRiskControl`
WHERE
/* Replace with a VARCHAR(16) */
`riskFirm` = 'Example_riskFirm'
AND
/* Replace with a VARCHAR(16) */
`riskGroup` = 'Example_riskGroup'
AND
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt` = 'None';

UPDATE TABLE EXAMPLE QUERY

UPDATE `SRControl`.`MsgMarRiskControl` 
SET
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`stkEnabled` = 'None',
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`futEnabled` = 'None',
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`optEnabled` = 'None',
/* Replace with a FLOAT */
`marginLimitAcc` = 1.23,
/* Replace with a FLOAT */
`marginLimitDay` = 1.23,
/* Replace with a FLOAT */
`openExposureLimit` = 1.23,
/* Replace with a INT */
`maxAccFutCnAbs` = 5,
/* Replace with a INT */
`maxDayFutCnBot` = 5,
/* Replace with a INT */
`maxDayFutCnSld` = 5,
/* Replace with a INT */
`maxDayFutCnAbs` = 5,
/* Replace with a INT */
`orderMaxStkQty` = 5,
/* Replace with a INT */
`orderMaxFutQty` = 5,
/* Replace with a INT */
`orderMaxOptQty` = 5,
/* Replace with a FLOAT */
`orderMaxStkDDelta` = 1.23,
/* Replace with a FLOAT */
`orderMaxFutDDelta` = 1.23,
/* Replace with a FLOAT */
`orderMaxOptDDelta` = 1.23,
/* Replace with a FLOAT */
`stkCollarPct` = 1.23,
/* Replace with a FLOAT */
`futCollarPct` = 1.23,
/* Replace with a FLOAT */
`optCollarPct` = 1.23,
/* Replace with a ENUM('None','Yes','No') */
`allowStkOddLots` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`allowLimitOnClose` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`allowMarketOnClose` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`allowShortSaleExempt` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`allowInterMarketSweep` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`blockShortSales` = 'None',
/* Replace with a DATETIME(6) */
`timestamp` = '2022-01-01 12:34:56.000000'
WHERE
/* Replace with a VARCHAR(16) */
`riskFirm` = 'Example_riskFirm'
AND
/* Replace with a VARCHAR(16) */
`riskGroup` = 'Example_riskGroup'
AND
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt` = 'None';

INSERT TABLE EXAMPLE QUERY

INSERT INTO `SRControl`.`MsgMarRiskControl`(
/* Replace with a VARCHAR(16) */
`riskFirm`,
/* Replace with a VARCHAR(16) */
`riskGroup`,
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt`,
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`stkEnabled`,
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`futEnabled`,
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`optEnabled`,
/* Replace with a FLOAT */
`marginLimitAcc`,
/* Replace with a FLOAT */
`marginLimitDay`,
/* Replace with a FLOAT */
`openExposureLimit`,
/* Replace with a INT */
`maxAccFutCnAbs`,
/* Replace with a INT */
`maxDayFutCnBot`,
/* Replace with a INT */
`maxDayFutCnSld`,
/* Replace with a INT */
`maxDayFutCnAbs`,
/* Replace with a INT */
`orderMaxStkQty`,
/* Replace with a INT */
`orderMaxFutQty`,
/* Replace with a INT */
`orderMaxOptQty`,
/* Replace with a FLOAT */
`orderMaxStkDDelta`,
/* Replace with a FLOAT */
`orderMaxFutDDelta`,
/* Replace with a FLOAT */
`orderMaxOptDDelta`,
/* Replace with a FLOAT */
`stkCollarPct`,
/* Replace with a FLOAT */
`futCollarPct`,
/* Replace with a FLOAT */
`optCollarPct`,
/* Replace with a ENUM('None','Yes','No') */
`allowStkOddLots`,
/* Replace with a ENUM('None','Yes','No') */
`allowLimitOnClose`,
/* Replace with a ENUM('None','Yes','No') */
`allowMarketOnClose`,
/* Replace with a ENUM('None','Yes','No') */
`allowShortSaleExempt`,
/* Replace with a ENUM('None','Yes','No') */
`allowInterMarketSweep`,
/* Replace with a ENUM('None','Yes','No') */
`blockShortSales`,
/* Replace with a DATETIME(6) */
`timestamp`
)
VALUES(
'Example_riskFirm',
'Example_riskGroup',
'None',
'None',
'None',
'None',
1.23,
1.23,
1.23,
5,
5,
5,
5,
5,
5,
5,
1.23,
1.23,
1.23,
1.23,
1.23,
1.23,
'None',
'None',
'None',
'None',
'None',
'None',
'2022-01-01 12:34:56.000000'
);

DELETE TABLE EXAMPLE QUERY

DELETE FROM `SRControl`.`MsgMarRiskControl` 
WHERE
/* Replace with a VARCHAR(16) */
`riskFirm` = 'Example_riskFirm'
AND
/* Replace with a VARCHAR(16) */
`riskGroup` = 'Example_riskGroup'
AND
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt` = 'None';

Doc Columns Query

SELECT * FROM SRControl.doccolumns WHERE TABLE_NAME='MarRiskControl' ORDER BY ordinal_position ASC;